import request from "@/utils/request";
// var Authorization = uni.getStorageSync('token')
/**
 * 测试
 */
// 登录
export function login(data) {
	return request.get({
		url: "/baseModule/user/front/wxLogin",
		data: data
	});
}
// 地址列表
export function addressList(data, token) {
	return request.get({
		url: "/goods/address/front/list",
		data: data,
		header: {
			Accept: "application/json; charset=utf-8",
			Authorization: token
		},
	});
}
// 新增地址
export function addressAdd(data, token) {
	return request.post({
		url: "/goods/address/front/add",
		data: data,
		header: {
			Accept: "application/json; charset=utf-8",
			Authorization: token
		},
	});
}
// 地址修改
export function addressEdit(data, token) {
	return request.post({
		url: "/goods/address/front/edit",
		data: data,
		header: {
			Accept: "application/json; charset=utf-8",
			Authorization: token
		},
	});
}
// 地址详情
export function addressInfo(data, token) {
	return request.get({
		url: "/goods/address/front/info",
		data: data,
		header: {
			Accept: "application/json; charset=utf-8",
			Authorization: token
		},
	});
}
// 地址删除
export function addressDelete(data, token) {
	return request.get({
		url: "/goods/address/front/delete",
		data: data,
		header: {
			Accept: "application/json; charset=UTF-8",
			Authorization: token
		},
	});
}
// 优惠券列表
export function ocouponList(data, token) {
	return request.get({
		url: "/goods/coupon/front/list",
		data: data,
		header: {
			Accept: "application/json; charset=UTF-8",
			Authorization: token
		},
	});
}
// 领取优惠券列表
export function couponTemplateList(data, token) {
	return request.get({
		url: "/goods/couponTemplate/front/list",
		data: data,
		header: {
			Accept: "application/json; charset=UTF-8",
			Authorization: token
		},
	});
}
// 领取优惠券
export function couponAdd(data, token) {
	return request.post({
		url: "/goods/coupon/front/add",
		data: data,
		header: {
			Accept: "application/json;charset=UTF-8",
			Authorization: token
		},
	});
}
// 产品列表
export function orderProductList(data, token) {
	return request.get({
		url: "/goods/orderProduct/front/list",
		params: data,
		header: {
			Accept: "application/json;charset=UTF-8",
			Authorization: token
		},
	});
}
// 轮播图接口
export function baseModuleList() {
	return request.get({
		url: "/baseModule/picture/front/list",
	});
}
// 群二维码接口
export function customizationList() {
	return request.get({
		url: "/customization/qrcode/front/list",
	});
}
// 产品接口
export function productList(token) {
	return request.get({
		url: "/goods/product/front/typeList",
		header: {
			Accept: "application/json;charset=UTF-8",
			Authorization: token
		},
	});
}
// 个人信息接口
export function userInfo(token) {
	return request.get({
		url: "/baseModule/user/front/info",
		header: {
			Accept: "application/json;charset=UTF-8",
			Authorization: token
		},
	});
}
// 保存个人信息接口
export function userEdit(data, token) {
	return request.post({
		url: "/baseModule/user/front/edit",
		data,
		header: {
			Accept: "application/json;charset=UTF-8",
			Authorization: token
		},
	});
}
// 产品详情
export function frontInfo(data, token) {
	return request.get({
		url: "/goods/product/front/info",
		data,
		header: {
			Accept: "application/json;charset=UTF-8",
			Authorization: token
		},
	});
}
//温度/甜度列表
export function dataDictionaryList(data, token) {
	return request.get({
		url: "/baseModule/dataDictionary/front/list",
		data,
		header: {
			Accept: "application/json;charset=UTF-8",
			Authorization: token
		},
	});
}
//小料列表
export function condimentList(data, token) {
	return request.get({
		url: "/goods/condiment/front/list",
		data,
		header: {
			Accept: "application/json;charset=UTF-8",
			Authorization: token
		},
	});
}
//新增购物车
export function shoppingCartAdd(data, token) {
	return request.post({
		url: "/goods/shoppingCart/front/add",
		data,
		header: {
			Accept: "application/json;charset=UTF-8",
			Authorization: token
		},
	});
}
//新增订单产品
export function orderProductAdd(data, token) {
	return request.post({
		url: "/goods/orderProduct/front/add",
		data,
		header: {
			Accept: "application/json;charset=UTF-8",
			Authorization: token
		},
	});
}
//购物车列表
export function shoppingCartList(token) {
	return request.get({
		url: "/goods/shoppingCart/front/list",
		header: {
			Accept: "application/json;charset=UTF-8",
			Authorization: token
		},
	});
}
//购物车清空
export function shoppingCartDel(data,token) {
	return request.get({
		url: "/goods/shoppingCart/front/delete",
		data,
		header: {
			Accept: "application/json;charset=UTF-8",
			Authorization: token
		},
	});
}
//购物车编辑
export function shoppingCartEdit(data,token) {
	return request.post({
		url: "/goods/shoppingCart/front/edit",
		data,
		header: {
			Accept: "application/json;charset=UTF-8",
			Authorization: token
		},
	});
}
//新增订单
export function orderAdd(data,token) {
	return request.post({
		url: "/goods/order/front/add",
		data,
		header: {
			Accept: "application/json;charset=UTF-8",
			Authorization: token
		},
	});
}
//调微信支付
export function orderUnifiedorder(data,token) {
	return request.get({
		url: "/goods/order/front/unifiedorder",
		data,
		header: {
			Accept: "application/json;charset=UTF-8",
			Authorization: token
		},
	});
}
//订单列表
export function orderList(data,token) {
	return request.get({
		url: "/goods/order/front/list",
		data,
		header: {
			Accept: "application/json;charset=UTF-8",
			Authorization: token
		},
	});
}
//订单详情
export function orderInfo(data,token) {
	return request.get({
		url: "/goods/order/front/info",
		data,
		header: {
			Accept: "application/json;charset=UTF-8",
			Authorization: token
		},
	});
}

//取消订单
export function orderCancel(data,token) {
	return request.post({
		url: "/goods/order/front/cancel",
		data,
		header: {
			Accept: "application/json;charset=UTF-8",
			Authorization: token
		},
	});
}
